#pragma once

#include "SynTableEntry.h"

SynTableEntry::SynTableEntry(Synonym* synonym, int index) {
	this->thisSynonym = synonym;
	this->entryNo = index;
}

Synonym* SynTableEntry::getSynonym()
{
	return thisSynonym;
}

int SynTableEntry::getEntryNo()
{
	return entryNo;
}

bool SynTableEntry::checkValue(int value)
{
	int size = values.size();
	for(int i=0; i<size; i++)
	{
		if(values[i] == value)
			return true;
	}
	return false;
}

bool SynTableEntry::checkValues(std::vector<int> toCheck)
{
	int size = toCheck.size();
	std::vector<int> newValues;

	for(int i=0; i<size; i++)
	{
		int value = toCheck.at(i);
		if(checkValue(value))
		{
			newValues.insert(newValues.begin(), value);
		}
	}

	values = newValues;
	if(values.empty())
		return false;
	else
		return true;
}

void SynTableEntry::addValue(int value)
{
	values.insert(values.end(), value);
}

void SynTableEntry::addValues(std::vector<int> newValues)
{
	int size = newValues.size();
	for(int i=0; i<size; i++)
	{
		int value = newValues.at(i);
		addValue(value);
	}
}
	
std::vector<int> SynTableEntry::getValues()
{
	return values;
}